/*******************************************************************************
 *
 * FILE NAME          : MxL68x_PhySpurTable.cpp
 * 
 * AUTHOR             : Dong Liu                 
 *
 * DATE CREATED       : 05/31/2012
 *
 * DESCRIPTION        : This file contains spur shift table that used in channel 
 *                      tune procedure 
 *                             
 *******************************************************************************
 *                Copyright (c) 2012, MaxLinear, Inc.
 ******************************************************************************/

#include "MxL68x_PhySpurTable.h"
#include "MxL68x_PhyCfg.h"

// Below lookup table of frequencies in different applications mode
// on which optimized channel tunning settings will be configured

// Table : 24
// NTSC XTAL=16MHz LIF
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_NTSC_LUT_XTAL_16MHZ_LIF[] = 
{ 
  {1, 0x1C, 0x17, 0x00, 0xD8},
  { 57000000, 0x19, 0x39, 0x00, 0xD8},
  {111000000, 0x1C, 0x17, 0x20, 0xD7},
  {177000000, 0x1C, 0x17, 0x20, 0xDB},
  {201000000, 0x1C, 0x17, 0x20, 0xDC},
  {219000000, 0x1C, 0x17, 0x20, 0xD7},
  {285000000, 0x1F, 0x3F, 0x20, 0xD7},
  {363000000, 0x1B, 0x3B, 0x20, 0xD8},
  {651000000, 0x1C, 0x17, 0x20, 0xD4},
  {663000000, 0x1C, 0x17, 0x20, 0xD7},
  {675000000, 0x1C, 0x17, 0x20, 0xD5},
  {705000000, 0x1C, 0x17, 0x20, 0xD5},
  {813000000, 0x1C, 0x17, 0x20, 0xD5},
  {861000000, 0x1C, 0x17, 0x20, 0xD5},
  {867000000, 0x1C, 0x17, 0x20, 0xD7},
  {879000000, 0x1C, 0x17, 0x20, 0xD3},
  {0, 0, 0, 0, 0},
};

// Table : 25
// NTSC XTAL=24MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_NTSC_LUT_XTAL_24MHZ[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0x90},
  {123000000, 0x19, 0x39, 0x20, 0x8D},
  {177000000, 0x1F, 0x3F, 0x20, 0x90},
  {231000000, 0x1D, 0x3D, 0x20, 0x90},
  {255000000, 0x19, 0x39, 0x20, 0x90},
  {699000000, 0x1A, 0x3A, 0x20, 0x90},
  {705000000, 0x19, 0x39, 0x20, 0x8F},
  {0, 0, 0, 0, 0},
};

// Table : 26
// NTSC HRC XTAL=16MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_NTSC_LUT_HRC_16MHZ[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0xD8},
  {55750000, 0x19, 0x39, 0x20, 0xD8},
  {283765625, 0x1E, 0x3E, 0x20, 0xD8},
  {649781250, 0x1A, 0x3A, 0x20, 0xD8},
  {883794100, 0x1C, 0x17, 0x20, 0xD7},
  {0, 0, 0, 0, 0},
};

// Table : 27
// NTSC HRC XTAL=24MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_NTSC_LUT_HRC_24MHZ[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0x90},
  {271765625, 0x1E, 0x3E, 0x20, 0x8F},
  {283765625, 0x1E, 0x3E, 0x20, 0x90},
  {0, 0, 0, 0, 0},
};

// Table : 28
// NTSC IRC XTAL=16MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_NTSC_LUT_IRC_16MHZ[] = 
{ 
  {1, 0x1C, 0x17, 0x00, 0xD8},
  {111012500, 0x1C, 0x17, 0x20, 0xD7},
  {177012500, 0x1F, 0x3F, 0x20, 0xD8},
  {219012500, 0x1C, 0x17, 0x20, 0xD7},
  {285012500, 0x1F, 0x3F, 0x20, 0xD8},
  {363012500, 0x1B, 0x3B, 0x20, 0xD8},
  {663012500, 0x1C, 0x17, 0x20, 0xD7},
  {759012500, 0x1C, 0x17, 0x20, 0xD6},
  {813012500, 0x1C, 0x17, 0x20, 0xD5},
  {867012500, 0x1C, 0x17, 0x20, 0xD7},
  {0, 0, 0, 0, 0},
};

// Table : 29
// NTSC IRC XTAL=24MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_NTSC_LUT_IRC_24MHZ[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0x90},
  {123015625, 0x19, 0x39, 0x20, 0x8D},
  {231015625, 0x15, 0x35, 0x20, 0x8E},
  {0, 0, 0, 0, 0},
};

// Table : new, updated on May.31
// PAL-MN, either 16MHz or 24MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_PAL_MN_LUT[] = 
{ 
  {1, 0x1C, 0x17, 0x00, 0xD8},
  { 63143000, 0x1C, 0x17, 0x20, 0xD7},
  {177000000, 0x1C, 0x17, 0x20, 0xDB},
  {405143000, 0x1C, 0x17, 0x20, 0xD5},
  {621143000, 0x1C, 0x17, 0x20, 0xD9},
  {0, 0, 0, 0, 0},
};

// Table : 31
// PAL-B/G 7MHz XTAL=16MHz LIF
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_PAL_BG_7MHZ_LUT_XTAL_16MHZ_LIF[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0xD8},
  { 50500000, 0x1C, 0x17, 0x20, 0xDB},
  { 57500000, 0x1C, 0x17, 0x20, 0xD5},
  {114500000, 0x1C, 0x17, 0x20, 0xDB},
  {219500000, 0x1C, 0x17, 0x20, 0xD7},
  {0, 0, 0, 0, 0},
};

// Table : 32
// PAL-B/G 7MHz XTAL=24MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_PAL_BG_7MHZ_LUT_XTAL_24MHZ[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0x90},
  {128500000, 0x1F, 0x3F, 0x20, 0x91},
  {149500000, 0x1B, 0x3B, 0x20, 0x8F},
  {0, 0, 0, 0, 0},
};

// Table : 33
// PAL-B/G 8MHz XTAL=16MHz LIF
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_PAL_BG_8MHZ_LUT_XTAL_16MHZ_LIF[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0xD8},
  {378000000, 0x1A, 0x3A, 0x20, 0xD5},
  {418000000, 0x1E, 0x3E, 0x20, 0xD4},
  {594000000, 0x19, 0x39, 0x20, 0xDA},
  {786000000, 0x1C, 0x17, 0x20, 0xD5},
  {834000000, 0x1A, 0x3A, 0x20, 0xD5},
  {0, 0, 0, 0, 0},
};

// Table : 34
// PAL-B/G 8MHz XTAL=24MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_PAL_BG_8MHZ_LUT_XTAL_24MHZ[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0x90},
  {314000000, 0x1F, 0x3F, 0x20, 0x93},
  {378000000, 0x1E, 0x3E, 0x20, 0x91},
  {386000000, 0x18, 0x38, 0x20, 0x8C},
  {418000000, 0x1B, 0x3B, 0x20, 0x91},
  {450000000, 0x1C, 0x3C, 0x20, 0x8E},
  {602000000, 0x19, 0x39, 0x20, 0x8F},
  {0, 0, 0, 0, 0},
};

// Table : 35
// PAL-D XTAL=16MHz LIF
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_PAL_D_LUT_XTAL_16MHZ_LIF[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0xD8},
  { 65000000, 0x1D, 0x17, 0x20, 0xDE},
  {116000000, 0x1D, 0x17, 0x20, 0xD6},
  {227000000, 0x1A, 0x3A, 0x20, 0xDA},
  {243000000, 0x1D, 0x17, 0x00, 0xD8},
  {275000000, 0x1D, 0x17, 0x20, 0xD9},
  {365000000, 0x1D, 0x17, 0x20, 0xD7},
  {898000000, 0x1D, 0x3D, 0x20, 0xD5},
  {0, 0, 0, 0, 0},
};

// Table : 36
// PAL-D XTAL=24MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_PAL_D_LUT_XTAL_24MHZ[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0x90},
  {147000000, 0x1A, 0x3A, 0x20, 0x8E},
  {259000000, 0x1B, 0x3B, 0x20, 0x8D},
  {275000000, 0x1A, 0x3A, 0x20, 0x8E},
  {602000000, 0x1C, 0x3C, 0x20, 0x8E},
  {834000000, 0x1B, 0x3B, 0x20, 0x8E},
  {898000000, 0x1D, 0x3D, 0x20, 0x8E},
  {0, 0, 0, 0, 0},
};

// Table : 37
// PAL-I XTAL=16MHz LIF
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_PAL_I_LUT_XTAL_16MHZ_LIF[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0xD8},
  {55000000, 0x1D, 0x17, 0x20, 0xCB},
  {80500000, 0x1A, 0x3A, 0x20, 0xE3},
  {186000000, 0x1D, 0x17, 0x0, 0xD8},
  {418000000, 0x1E, 0x3E, 0x20, 0xD5},
  {594000000, 0x19, 0x39, 0x20, 0xDA},
  {874000000, 0x1D, 0x17, 0x20, 0xD6},
  {898000000, 0x1D, 0x3D, 0x20, 0xD5},
  {0, 0, 0, 0, 0},
};

// Table : 38
// PAL-I XTAL=24MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_PAL_I_LUT_XTAL_24MHZ[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0x90},
  {152500000, 0x19, 0x39, 0x20, 0x90},
  {418000000, 0x1B, 0x3B, 0x20, 0x91},
  {458000000, 0x1A, 0x3A, 0x20, 0x90},
  {898000000, 0x1D, 0x3D, 0x20, 0x8E},
  {0, 0, 0, 0, 0},
};

// Table : 39
// SECAM L XTAL=16MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_SECAM_L_LUT_XTAL_16MHZ[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0xD8},
  {242750000, 0x1D, 0x17, 0x0, 0xD8},
  {346750000, 0x1B, 0x3B, 0x20, 0xD9},
  {0, 0, 0, 0, 0},
};

// Table : 40
// SECAM-L XTAL=24MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_SECAM_L_LUT_XTAL_24MHZ[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0x90},
  {226750000, 0x19, 0x39, 0x20, 0x8F},
  {346750000, 0x1D, 0x3D, 0x20, 0x8F},
  {0, 0, 0, 0, 0},
};

// Table : 50
// PAL-D XTAL=16MHz HIF
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_PAL_D_LUT_XTAL_16MHZ_HIF[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0xD8},
  {171000000, 0x1D, 0x17, 0x20, 0xD9},
  {179000000, 0x1D, 0x17, 0x20, 0xD3},
  {187000000, 0x1D, 0x17, 0x20, 0xDD},
  {227000000, 0x1D, 0x17, 0x20, 0xDB},
  {315000000, 0x1D, 0x17, 0x20, 0xD7},
  {339000000, 0x1D, 0x17, 0x20, 0xD5},
  {363000000, 0x1D, 0x17, 0x20, 0xDB},
  {387000000, 0x1D, 0x17, 0x20, 0xD6},
  {443000000, 0x1D, 0x17, 0x20, 0xDA},
  {522000000, 0x1D, 0x17, 0x20, 0xD7},
  {666000000, 0x1D, 0x17, 0x20, 0xD7},
  {738000000, 0x1D, 0x17, 0x20, 0xD7},
  {834000000, 0x1D, 0x17, 0x20, 0xDA},
  {0, 0, 0, 0, 0},
};

// Table : 51
// PAL-I XTAL=16MHz HIF
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_PAL_I_LUT_XTAL_16MHZ_HIF[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0xD8},
  {48500000, 0x1D, 0x17, 0x20, 0xD7},
  {55000000, 0x1D, 0x17, 0x20, 0xC9},
  {64500000, 0x1D, 0x17, 0x20, 0xDE},
  {96500000, 0x1D, 0x17, 0x20, 0xD1},
  {120500000, 0x1D, 0x17, 0x20, 0xE0},
  {144500000, 0x1D, 0x17, 0x20, 0xDA},
  {178000000, 0x1D, 0x17, 0x20, 0xD6},
  {186000000, 0x1D, 0x17, 0x20, 0xDC},
  {226000000, 0x1D, 0x17, 0x20, 0xDB},
  {234000000, 0x1D, 0x17, 0x20, 0xD7},
  {306000000, 0x1D, 0x17, 0x20, 0xD7},
  {394000000, 0x1D, 0x17, 0x20, 0xD9},
  {410000000, 0x1D, 0x17, 0x20, 0xD7},
  {450000000, 0x1D, 0x17, 0x20, 0xD6},
  {522000000, 0x1D, 0x17, 0x20, 0xD7},
  {666000000, 0x1D, 0x17, 0x20, 0xD7},
  {738000000, 0x1D, 0x17, 0x20, 0xD7},
  {874000000, 0x1D, 0x17, 0x20, 0xD7},
  {882000000, 0x1D, 0x17, 0x20, 0xD7},
  {0, 0, 0, 0, 0},
};

// Table : 52
// PAL-BG XTAL=16MHz HIF
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_PAL_BG_7MHZ_LUT_XTAL_16MHZ_HIF[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0xD8},
  {57500000, 0x1D, 0x17, 0x20, 0xD7},
  {191500000, 0x1D, 0x17, 0x20, 0xD5},
  {219500000, 0x1D, 0x17, 0x20, 0xD7},
  {240500000, 0x1D, 0x17, 0x20, 0xDB},
  {282500000, 0x1D, 0x17, 0x20, 0xDC},
  {296500000, 0x1D, 0x17, 0x20, 0xDC},
  {0, 0, 0, 0, 0},
};

// Table : 53
// PAL-BG XTAL=16MHz HIF
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_PAL_BG_8MHZ_LUT_XTAL_16MHZ_HIF[] = 
{ 
  {1, 0x1D, 0x17, 0x00, 0xD8},
  {306000000, 0x1D, 0x17, 0x20, 0xD9},
  {314000000, 0x1D, 0x17, 0x20, 0xD6},
  {450000000, 0x1D, 0x17, 0x20, 0xD7},
  {522000000, 0x1D, 0x17, 0x20, 0xD7},
  {666000000, 0x1D, 0x17, 0x20, 0xD7},
  {730000000, 0x1D, 0x17, 0x20, 0xD3},
  {738000000, 0x1D, 0x17, 0x20, 0xD7},
  {0, 0, 0, 0, 0},
};

// Table : 54
// NTSC XTAL=16MHz HIF
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_NTSC_LUT_XTAL_16MHZ_HIF[] = 
{ 
  {1, 0x1C, 0x17, 0x00, 0xD8},
  {99000000, 0x1C, 0x17, 0x20, 0xD7},
  {111000000, 0x1C, 0x17, 0x20, 0xD6},
  {219000000, 0x1C, 0x17, 0x20, 0xD7},
  {261000000, 0x1C, 0x17, 0x20, 0xD9},
  {333000000, 0x1C, 0x17, 0x20, 0xD9},
  {363000000, 0x1C, 0x17, 0x20, 0xDB},
  {387000000, 0x1C, 0x17, 0x20, 0xD9},
  {441000000, 0x1C, 0x17, 0x20, 0xD9},
  {447000000, 0x1C, 0x17, 0x20, 0xD6},
  {495000000, 0x1C, 0x17, 0x20, 0xD7},
  {549000000, 0x1C, 0x17, 0x20, 0xD7},
  {603000000, 0x1C, 0x17, 0x20, 0xD7},
  {663000000, 0x1C, 0x17, 0x20, 0xD6},
  {705000000, 0x1C, 0x17, 0x20, 0xD7},
  {735000000, 0x1C, 0x17, 0x20, 0xD7},
  {867000000, 0x1C, 0x17, 0x20, 0xD7},
  {0, 0, 0, 0, 0},
};

// Table : 60
// Digital Cable 6MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_DIG_CABLE_LUT_BW_6MHZ[] = 
{ 
  {1, 0x1C, 0x17, 0x00, 0xD8},
  {0, 0, 0, 0, 0},
};

// Table : 61
// Digital Cable 8MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_DIG_CABLE_LUT_BW_8MHZ[] = 
{ 
  {1, 0x1C, 0x17, 0x00, 0xD8},
  {0, 0, 0, 0, 0},
};

// Table : 62
// Digital Terestrial 6MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_DIG_TERR_LUT_BW_6MHZ[] = 
{ 
  {1, 0x1C, 0x17, 0x00, 0xD8},
  {0, 0, 0, 0, 0},
};

// Table : 63
// Digital Terestrial 7MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_DIG_TERR_LUT_BW_7MHZ[] = 
{ 
  {1, 0x1C, 0x17, 0x00, 0xD8},
  {0, 0, 0, 0, 0},
};

// Table : 64
// Digital Terestrial 8MHz
MXL68x_CHAN_DEP_FREQ_TABLE_T MXL68x_DIG_TERR_LUT_BW_8MHZ[] = 
{ 
  {1, 0x1C, 0x17, 0x00, 0xD8},
  {0, 0, 0, 0, 0},
};
